<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script>
    window.onload = function (){
       let btnObj = document.getElementById("clickButton");
      //btnObj.onclick = speak;
       btnObj.onclick = function (){
         speak();
       }
    }
    function  speak(){
      alert("speak");
    }
  </script>
</head>
<body>
    <input type="button" value="点击" id="clickButton"/>
</body>
</html>
